<template>
  <div class="app-container" id="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="实习生" prop="internId">
        <el-select v-model="queryParams.internId"  placeholder="请选择实习生" @change="handleQuery">
          <el-option
            v-for="intern in internList"
            :key="intern.internId"
            :label="intern.studentName"
            :value="intern.internId"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="用户" prop="userId">
        <el-select v-model="queryParams.userId"  placeholder="请选择用户" @change="handleQuery">
          <el-option
            v-for="user in userList"
            :key="user.userId"
            :label="user.userName"
            :value="user.userId"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="审核人" prop="mentorId">
        <el-select v-model="queryParams.mentorId"  placeholder="请选择审核人" @change="handleQuery">
          <el-option
            v-for="user in userList"
            :key="user.userId"
            :label="user.userName"
            :value="user.userId"
          />
        </el-select>
      </el-form-item>
<!--      <el-form-item label="审核人ID" prop="mentorId">-->
<!--        <el-input-->
<!--          v-model="queryParams.mentorId"-->
<!--          placeholder="请输入审核人ID"-->
<!--          filterable clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->

      <!-- 更多查询条件-->
      <template v-if="isShowMore">
        <el-form-item label="审核时间" prop="reviewTime">
          <el-date-picker filterable clearable
                          v-model="queryParams.reviewTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择审核时间">
          </el-date-picker>
        </el-form-item>


      </template>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        <el-button :icon="isShowMore?'el-icon-d-arrow-right':'el-icon-d-arrow-left'" size="mini" type="warning" @click="isShowMore = !isShowMore">更多查询</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['collegeco:task:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['collegeco:task:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['collegeco:task:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['collegeco:task:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="taskList" @selection-change="handleSelectionChange" stripe :height="tableHeight">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column type="index" width="55" label="序号" align="center" fixed/>
      <el-table-column label="任务书ID" align="center" prop="taskId" />
<!--      <el-table-column label="实习生ID" align="center" prop="internId" />-->
<!--      <el-table-column label="用户ID" align="center" prop="userId" />-->

      <!-- 实习总体目标 -->
      <el-table-column label="实习总体目标" align="center" width="180">
        <template #default="scope">
          <el-tooltip placement="top" :open-delay="400" :enterable="true">
            <!-- Tooltip 内容：支持 HTML 渲染 -->
            <div slot="content" v-html="scope.row.internshipObjective"></div>
            <!-- 单元格显示：最多3行，超出省略 -->
            <div class="cell-html-ellipsis" v-html="scope.row.internshipObjective"></div>
          </el-tooltip>
        </template>
      </el-table-column>

      <!-- 实习具体内容 -->
      <el-table-column label="实习具体内容" align="center" min-width="200">
        <template #default="scope">
          <el-tooltip placement="top" :open-delay="400" :enterable="true">
            <div slot="content" v-html="scope.row.internshipContent"></div>
            <div class="cell-html-ellipsis" v-html="scope.row.internshipContent"></div>
          </el-tooltip>
        </template>
      </el-table-column>

      <!-- 实习阶段计划或时间安排 -->
      <el-table-column label="实习阶段计划或时间安排" align="center" min-width="200">
        <template #default="scope">
          <el-tooltip placement="top" :open-delay="400" :enterable="true">
            <div slot="content" v-html="scope.row.internshipPlan"></div>
            <div class="cell-html-ellipsis" v-html="scope.row.internshipPlan"></div>
          </el-tooltip>
        </template>
      </el-table-column>

      <!-- 实习要求 -->
      <el-table-column label="实习要求" align="center" width="180">
        <template #default="scope">
          <el-tooltip placement="top" :open-delay="400" :enterable="true">
            <div slot="content" v-html="scope.row.internshipRequirements"></div>
            <div class="cell-html-ellipsis" v-html="scope.row.internshipRequirements"></div>
          </el-tooltip>
        </template>
      </el-table-column>

      <el-table-column label="状态" prop="status" width="150">
        <template slot-scope="scope">
          <el-tag
            size="small"
            :type="getStatusType(scope.row.status)"
          >
            {{ getStatusLabel(scope.row.status) }}
          </el-tag>
        </template>
      </el-table-column>
<!--      <el-table-column label="审核人" align="center" >-->
<!--        <template slot-scope="scope">-->
<!--          {{ getUserNameById(scope.row.enterpriseMentor) }}-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column label="审核人" align="center" prop="mentor" />
<!--      <el-table-column label="审核人" align="center" >-->
<!--        <template slot-scope="scope">-->
<!--          {{ getUserNameById(scope.row.mentorId) }}-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column label="审核时间" align="center" prop="reviewTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.reviewTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="审核备注" align="center" prop="remarks" />
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
        <template slot-scope="scope">
          <el-button
              size="mini"
              type="text"
              icon="el-icon-info"
              @click="handleInfo(scope.row)"
              v-hasPermi="['collegeco:task:query']"
          >详情</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['collegeco:task:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['collegeco:task:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改实习生任务书对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="68%" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="实习生" prop="internId">
              <el-select v-model="form.internId"  placeholder="请选择实习生" >
                <el-option
                  v-for="intern in internList"
                  :key="intern.internId"
                  :label="intern.studentName"
                  :value="intern.internId"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="用户" prop="userId">
              <el-select v-model="form.userId"  placeholder="请选择用户" >
                <el-option
                  v-for="user in userList"
                  :key="user.userId"
                  :label="user.userName"
                  :value="user.userId"
                />
              </el-select>
            </el-form-item>
          </el-col>
      <el-col :span="24">
        <el-form-item label="实习总体目标">
          <editor v-model="form.internshipObjective" :min-height="192"/>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="实习具体内容">
          <editor v-model="form.internshipContent" :min-height="192"/>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="实习阶段计划或时间安排">
          <editor v-model="form.internshipPlan" :min-height="192"/>
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="实习要求">
          <editor v-model="form.internshipRequirements" :min-height="192"/>
        </el-form-item>
      </el-col>
<!--      <el-col :span="8">-->
<!--            <el-form-item label="审核人" prop="enterpriseMentor">-->
<!--              <el-select v-model="form.enterpriseMentor"  placeholder="请选择审核人" >-->
<!--                <el-option-->
<!--                  v-for="user in userList"-->
<!--                  :key="user.userId"-->
<!--                  :label="user.userName"-->
<!--                  :value="user.userId"-->
<!--                />-->
<!--              </el-select>-->
<!--            </el-form-item>-->
<!--      </el-col>-->
<!--          <el-col :span="8">-->
<!--            <el-form-item label="审核人" prop="mentor">-->
<!--              <el-input v-model="form.mentor"  placeholder="请输入审核人" />-->
<!--            </el-form-item>-->
<!--          </el-col>-->
          <el-col :span="8">
            <el-form-item label="审核人" prop="mentorId">
              <el-select v-model="form.mentorId"  placeholder="请选择审核人" @change="handleGetUserName">
                <el-option
                  v-for="user in userList"
                  :key="user.userId"
                  :label="user.userName"
                  :value="user.userId"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
                <el-form-item label="审核时间" prop="reviewTime">
                  <el-date-picker filterable clearable
                    v-model="form.reviewTime"
                    type="date"
                    value-format="yyyy-MM-dd"
                    placeholder="请选择审核时间">
                  </el-date-picker>
                </el-form-item>
          </el-col>
          <el-col :span="24">
                <el-form-item label="审核备注" prop="remarks">
                  <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
                </el-form-item>
          </el-col>
<!--      <el-col :span="8">-->
<!--            <el-form-item label="删除逻辑标识" prop="delFlag">-->
<!--              <el-input v-model="form.delFlag"  placeholder="请输入删除逻辑标识" />-->
<!--            </el-form-item>-->
<!--      </el-col>-->
          <el-col :span="24">
                <el-form-item label="备注" prop="remark">
                  <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
                </el-form-item>
          </el-col>
          <el-col :span="14">
            <el-form-item label="状态" prop="status">
              <el-radio-group v-model="form.status">
                <el-radio
                  v-for="dict in dict.type.collegeco_intern_task_status"
                  :key="dict.value"
                  :label="dict.value"
                >
                  {{ dict.label }}
                </el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 实习生任务书详情对话框（平铺式卡片模板） -->
    <el-dialog
      :title="title"
      :visible.sync="openInfo"
      width="75%"
      append-to-body
      :close-on-click-modal="false"
      @close="cancel"
    >
      <div class="intern-task-detail-container">
        <!-- 模块1：实习生基本信息 -->
        <el-card shadow="hover" class="detail-card">
          <div slot="header" class="card-header">
            <span style="font-weight: 600; font-size: 16px; color: #1890ff; margin-left: 6px;">👤 实习生基本信息</span>
          </div>
          <el-row :gutter="20" class="detail-row">
            <el-col :span="8"><strong>实习生姓名：</strong> {{ studentName || '—' }}</el-col>
            <el-col :span="8"><strong>用户账号：</strong> {{ userName || '—' }}</el-col>
            <el-col :span="8"><strong>学号：</strong> {{ currentIntern.studentNo || '—' }}</el-col>
          </el-row>
          <el-row :gutter="20" class="detail-row">
            <el-col :span="8"><strong>学校：</strong> {{ currentIntern.school || '—' }}</el-col>
            <el-col :span="8"><strong>学院：</strong> {{ currentIntern.college || '—' }}</el-col>
            <el-col :span="8"><strong>专业：</strong> {{ currentIntern.major || '—' }}</el-col>
          </el-row>
          <el-row :gutter="20" class="detail-row">
            <el-col :span="8"><strong>班级：</strong> {{ currentIntern.className || '—' }}</el-col>
            <el-col :span="8"><strong>实习单位：</strong> {{ currentIntern.internshipCompany || '—' }}</el-col>
            <el-col :span="8"><strong>实习岗位：</strong> {{ currentIntern.internshipPosition || '—' }}</el-col>
          </el-row>
          <el-row :gutter="20" class="detail-row">
            <el-col :span="8"><strong>实习开始：</strong> {{ parseTime(currentIntern.internshipStart, '{y}-{m}-{d}') || '—' }}</el-col>
            <el-col :span="8"><strong>实习结束：</strong> {{ parseTime(currentIntern.internshipEnd, '{y}-{m}-{d}') || '—' }}</el-col>
            <el-col :span="8"><strong>学校导师：</strong> {{ currentIntern.instructorTeacher || '—' }}</el-col>
          </el-row>
          <el-row :gutter="20" class="detail-row">
            <el-col :span="8"><strong>企业导师：</strong> {{ currentIntern.enterpriseMentor || '—' }}</el-col>
          </el-row>
        </el-card>

        <!-- 模块2：任务书内容 -->
        <el-card shadow="hover" class="detail-card">
          <div slot="header" class="card-header">
            <span style="font-weight: 600; font-size: 16px; color: #faad14; margin-left: 6px;">📋 实习任务书内容</span>
          </div>
          <div class="report-section">
            <p class="section-title"><strong>实习总体目标</strong></p>
            <div v-html="form.internshipObjective" class="content-html"></div>
          </div>
          <div class="report-section">
            <p class="section-title"><strong>实习具体内容</strong></p>
            <div v-html="form.internshipContent" class="content-html"></div>
          </div>
          <div class="report-section">
            <p class="section-title"><strong>实习阶段计划或时间安排</strong></p>
            <div v-html="form.internshipPlan" class="content-html"></div>
          </div>
          <div class="report-section">
            <p class="section-title"><strong>实习要求</strong></p>
            <div v-html="form.internshipRequirements" class="content-html"></div>
          </div>
        </el-card>

        <!-- 模块3：审核与备注信息 -->
        <el-card shadow="hover" class="detail-card">
          <div slot="header" class="card-header">
            <span style="font-weight: 600; font-size: 16px; color: #52c41a; margin-left: 6px;">✅ 审核与备注信息</span>
          </div>
          <el-row :gutter="20" class="detail-row">
            <el-col :span="8"><strong>审核人：</strong> {{ form.mentor || '—' }}</el-col>
            <el-col :span="8"><strong>审核时间：</strong> {{ parseTime(form.reviewTime, '{y}-{m}-{d}') || '—' }}</el-col>
          </el-row>
          <el-row :gutter="20" class="detail-row">
            <el-col :span="24"><strong>审核备注：</strong> {{ form.remarks || '—' }}</el-col>
          </el-row>
          <el-row :gutter="20" class="detail-row">
            <el-col :span="24"><strong>其他备注：</strong> {{ form.remark || '—' }}</el-col>
          </el-row>
        </el-card>
      </div>

      <!-- 对话框底部按钮 -->
      <div slot="footer" class="dialog-footer">
        <el-button @click="openInfo = false">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listTask, getTask, delTask, addTask, updateTask } from "@/api/collegeco/task";
import {listIntern} from "@/api/collegeco/intern";
import {listUser}  from "@/api/system/user";

export default {
  name: "Task",
  dicts: ['collegeco_intern_task_status'],
  data() {
    return {
      // 是否显示更多
      isShowMore: false,
      // el-table 高度
      tableHeight: 650, // 用于存储 el-table 的高度
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 实习生任务书表格数据
      taskList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 是否显示详情弹出层
      openInfo: false,
      currentIntern: {}, // 当前选中的实习生信息
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        internId: null,
        userId: null,
        internshipObjective: null,
        internshipContent: null,
        internshipPlan: null,
        internshipRequirements: null,
        status: null,
        mentor: null,
        mentorId: null,
        reviewTime: null,
        remarks: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        internId: [
          { required: true, message: "实习生ID", trigger: "blur" }
        ],
        userId: [
          { required: true, message: "用户ID", trigger: "blur" }
        ],
        internshipObjective: [
          { required: true, message: "实习总体目标不能为空", trigger: "blur" }
        ],
        internshipContent: [
          { required: true, message: "实习具体内容不能为空", trigger: "blur" }
        ],
      },
      // 实习生信息表格数据
      internList: [],
      // 用户表格数据
      userList: [],
    };
  },
  created() {
    this.getList();
    this.setTableHeight();
    window.addEventListener('resize', this.setTableHeight); // 监听窗口大小变化

    // 初始获取实习生信息
    this.getInternList();
    // 初始获取用户信息
    this.getUserList();
  },
  beforeDestroy() {
    window.removeEventListener('resize', this.setTableHeight); // 移除事件监听
  },
  computed: {
    studentName() {
      const intern = this.internList.find(item =>
        String(item.internId) === String(this.form.internId)
      );
      return intern ? intern.studentName : '未知实习生';
    },
    userName() {
      const user = this.userList.find(item =>
        String(item.userId) === String(this.form.userId)
      );
      return user ? user.userName : '未知用户';
    },
  },
  methods: {
    showInternDetailById(internId) {
      const intern = this.internList.find(item => item.internId == internId);

      if (intern) {
        this.currentIntern = intern;
        this.openInternInfo = true;
      } else {
        this.$message.warning('未找到该实习生的详细信息');
      }
    },

    // 根据 value 返回字典 label
    getStatusLabel(value) {
      console.log('当前 status 值:', value, '类型:', typeof value);
      const strValue = String(value);
      const dict = this.dict.type.collegeco_intern_task_status.find(item => item.value === strValue);
      return dict ? dict.label : '未知状态';
      },
    getStatusType(value) {
      switch (value) {
        case '1': return 'info';     // 待提交
        case '2': return 'warning';  // 审核中
        case '3': return 'success';  // 已通过
        case '4': return 'danger';   // 已驳回
        default: return 'info';
      }
    },
    /** 获取实习生信息 */
    getInternList(){
      listIntern(
        {
          pageNum: 1,
          pageSize: 10000,
        }).then(response => {
        this.internList = response.rows;
        console.log("internList",this.internList)

      });
    },
    getUserList(){
      listUser(
        {
          pageNum: 1,
          pageSize: 10000,
        }).then(response => {
        this.userList = response.rows;
        console.log("userList",this.userList)

      });
    },

    /** 查询实习生任务书列表 */
    getList() {
      this.loading = true;
      listTask(this.queryParams).then(response => {
        this.taskList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.openInfo = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        taskId: null,
        internId: null,
        userId: null,
        internshipObjective: null,
        internshipContent: null,
        internshipPlan: null,
        internshipRequirements: null,
        status: null,
        mentor: null,
        mentorId: null,
        reviewTime: null,
        remarks: null,
        createTime: null,
        updateTime: null,
        delFlag: null,
        createBy: null,
        updateBy: null,
        remark: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.taskId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加实习生任务书";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const taskId = row.taskId || this.ids
      getTask(taskId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改实习生任务书";
      });
    },
    /** 详情按钮操作 */
    handleInfo(row) {
      this.reset();
      const taskId = row.taskId || this.ids
      getTask(taskId).then(response => {
        this.form = response.data;
        // 根据 form.internId 从 internList 中查找实习生信息
        const intern = this.internList.find(item => item.internId == this.form.internId);
        if (intern) {
          this.currentIntern = intern; // 填充 currentIntern
        } else {
          this.currentIntern = {}; // 或设置默认值
          console.warn('未找到 ID 为', this.form.internId, '的实习生信息');
        }
        this.openInfo = true;
        this.title = "实习生任务书详情";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.taskId != null) {
            updateTask(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addTask(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const taskIds = row.taskId || this.ids;
      this.$modal.confirm('是否确认删除实习生任务书编号为"' + taskIds + '"的数据项？').then(function() {
        return delTask(taskIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('collegeco/task/export', {
        ...this.queryParams
      }, `实习生任务书数据导出_${new Date().getTime()}.xlsx`)
    },
    // 设置表格高度
    setTableHeight() {
      const appContainer = document.getElementById('app-container');
      if (appContainer) {
        this.tableHeight = appContainer.clientHeight * 0.8;
      }
    },
    // 在userList里面获取到username
    handleGetUserName(value){
      this.form.mentor = this.userList.find(item => item.userId === value).userName;
      console.log(value)
      console.log(this.form.mentor)
    },

  }
};
</script>
<style>
/* 统一单元格样式：最多显示3行，超出隐藏，带省略号 */
.cell-html-ellipsis {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  max-height: 4.5em;
  padding: 2px 0;
  margin: 0;
  font-size: 14px;
  cursor: pointer;
  text-align: left; /* 如果内容左对齐更清晰 */
}

/* 优化 Tooltip 样式，支持 HTML 列表展示 */
.el-tooltip__popper {
  max-width: 400px;
  max-height: 300px;
  overflow-y: auto;
  word-break: break-word;
  line-height: 1.6;
  text-align: left;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.el-tooltip__popper ul,
.el-tooltip__popper ol {
  margin: 8px 0;
  padding-left: 20px;
  margin-block-start: 0.3em;
  margin-block-end: 0.3em;
}
.el-tooltip__popper li {
  margin: 4px 0;
}
.el-tooltip__popper p {
  margin: 6px 0;
}
.el-tooltip__popper::-webkit-scrollbar {
  width: 6px;
}

.el-tooltip__popper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.el-tooltip__popper::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.el-tooltip__popper::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.intern-task-detail-container {
  max-height: 70vh;
  overflow-y: auto;
  padding: 10px;
}

.detail-card {
  margin-bottom: 16px;
  border-radius: 8px;
  font-size: 14px;
}

.card-header {
  display: flex;
  align-items: center;
  font-size: 16px;
}

.detail-row {
  margin: 6px 0;
}

.report-section {
  margin: 12px 0;
}

.section-title {
  margin: 0 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px dashed #ddd;
  color: #333;
  font-size: 15px;
}

.content-html {
  padding: 10px;
  background-color: #f9f9fb;
  border-radius: 4px;
  min-height: 40px;
  line-height: 1.6;
  color: #555;
  white-space: pre-wrap;
  font-size: 14px;
}

.content-html :global(p) {
  margin: 6px 0;
}

.content-html :global(img) {
  max-width: 100%;
  border-radius: 4px;
}
</style>
